#include "ThreadPool.hpp"
#include "Task.hpp"
using namespace ThreadPollModule;
int main()
{
    ThreadPool<Task>::GetInstance()->Start();
    int cnt = 5;
    while(cnt)
    {
        //std::cout<<"发送一个任务"<<std::endl;
        Task t;
        ThreadPool<Task>::GetInstance()->Equeue(t);
        sleep(1);
        cnt--;
    }
    ThreadPool<Task>::GetInstance()->Stop();
    ThreadPool<Task>::GetInstance()->Wait();


    // Task t;
    // ThreadPool<Task> tp;
    // int cnt = 5;
    // tp.Start();
    // while(cnt)
    // {
    //     //std::cout<<"发送一个任务"<<std::endl;
    //     tp.Equeue(t);
    //     sleep(1);
    //     cnt--;
    // }
    // tp.Stop();
    // tp.Wait();
    return 0;
}